export function emailCheck (email) {
  var emailreg = /^([a-zA-Z0-9]+[_|.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/
  if (!emailreg.test(email)) {
    return false
  }
  return true
}
export function pwdCheck (pwd) {
  var pwdreg = /^[a-zA-Z]\w{5,17}$/
  if (!pwdreg.test(pwd)) {
    return false
  }
  return true
}
export function getOptions(){
	const arr=[

              {
                text: '回归自然',
                url:"https://img.xbdzmp.com/202004281116122e2c5b4b5672.jpg",
                id:0
              },

              {
                text: '金碧辉煌',
               url:"https://img.xbdzmp.com/20200428111724ed9c42567b9c.jpg",
               id:1
              },
              {
                text: '青山绿水',
               url:"https://img.xbdzmp.com/20200428111831d75990ae5f0b.jpg",
               id:2
              },
              {
                text: '五彩缤纷',
               url:"https://img.xbdzmp.com/20200428111848ecc0c12b7311.jpg",
               id:3
              },

              {
                text: '黑色棱角',
               url:"https://img.xbdzmp.com/2020042811165528c242e8d7fb.jpg",
               id:4
              },
              {
                text: '成熟大气',
               url:"https://img.xbdzmp.com/202004281114523f6075ec9fb3.jpg",
               id:5
              },
              {
                url:"https://img.xbdzmp.com/20200430025630e97ede16e5a8.jpg",
                text:'蓝色精灵',
                id:6
              },
            ];
			return arr;
}
export function phoneNumCheck (phoneNUm) {
  var phoneNumreg = /^[1][3,4,5,7,8][0-9]{9}$/
  if (!phoneNumreg.test(phoneNUm)) {
    return false
  }
  return true
}
export function numberCheck (number) {
  var numberreg = /^\d+(?=\.{0,1}\d+$|$)/
  if (!numberreg.test(number)) {
    return false
  }
  return true
}

export function ValidatePhone (isPhone) {
  var isPhonereq = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/
  if (!isPhonereq.test(isPhone)) {
    return true
  } else {
    return false
  }
}
export function getTIme(date){
  var time = new Date(date)
  var year=time.getFullYear();
  var mouth=add0(time.getMonth()+1);
  var day=add0(time.getDate());
  var hours=add0(time.getHours());
  var Minutes=add0(time.getMinutes());
  var Seconds=add0(time.getSeconds());
  return year+'-'+mouth+'-'+day+' '+hours+':'+Minutes+':'+Seconds
}
function add0(str){
  if(Number(str)<=9){
    return '0'+str;
  }else{
    return str;
  }
}
export const appId="wx68642dce2b8ccbe7";
export const host = "https://www.xbdzmp.com"
// export const appSecret="735563fcc24261ba8c67749dd1ea49e7"
export  function toDecimal2(x) {
  var f = parseFloat(x);
  if (isNaN(f)) {
    return false;
  }
  var f = Math.round(x*100)/100;
  var s = f.toString();
  var rs = s.indexOf('.');
  if (rs < 0) {
    rs = s.length;
    s += '.';
  }
  while (s.length <= rs + 2) {
    s += '0';
  }
  //console.log(s)
  return s;
}
